package com.lighting.smssystem.constrants;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.core.enums.IEnum;

/**
 * Author LeeMaster
 */

public enum  UserRole implements IEnum<Integer> {

    COMMON(0),
    VIP(1),
    ADMIN(2);

    public int code;

    UserRole(int code) {
        this.code = code;
    }

    public static UserRole parse(int code){
        switch (code){
            case 1:
                return VIP;
            case 2:
                return ADMIN;
                default:
                    return COMMON;
        }
    }


    @Override
    public Integer getValue() {
        return this.code;
    }
}
